<?php

namespace App\ModelFilters;

use EloquentFilter\ModelFilter;

class PaperRealFilter extends ModelFilter
{
    /**
    * Related Models that have ModelFilters as well as the method on the ModelFilter
    * As [relationMethod => [input_key1, input_key2]].
    *
    * @var array
    */
    public $relations = [];

    public function paperType($value) {
        return $this->where('paperType', $value);
    }

    public function title($value) {
        return $this->where('title', 'like', '%'.$value.'%');
    }

    public function courseId($value) {
        return $this->whereIn('courseId', explode(',', $value));
        //return $this->where('courseId', $value);
    }

    public function uid($value) {
        return $this->where('uid', $value);
    }

    public function status($value) {
        return $this->where('status', $value);
    }
}
